cat octa.txt | awk '{print $1}' | xargs -i bash -c "cat simu.txt | sed '1i 0\\t2 -1' | awk '{if(\$1>={}) {printf old\" \"; print \$0}  old=\$0;}' | head -n 1" > 1
paste octa.txt 1  | awk '{ printf $0"   "; printf ($1-$4)/(0.01)*$8 + ($7-$1)/(0.01)*$5" " ; print ($1-$4)/0.01*$9 + ($7-$1)/0.01*$6 }' | awk '{printf $0"     "; printf sqrt(($2-$10)*($2-$10))/$2" "; printf sqrt(($3-$11)*($3-$11))/$3" "; printf $2-$10" "; print $3-$11}' | sort -g -k 15
